#include<stdio.h>
int main()
{
    //freopen("in.txt","r",stdin);
    int room[5][4][11] = {0};
    int n;
    scanf("%d",&n);
    for(int i = 0; i < n; i++)
    {
        int b,f,r,v;
        scanf("%d %d %d %d",&b,&f,&r,&v);
        room[b][f][r] += v;
    }
    for(int i = 1; i <= 4; i++)
    {
        for(int j = 1; j <= 3;j++)
        {
            for(int k = 1; k <= 10; k++)
            {
                printf(" %d",room[i][j][k]);
            }
            printf("\n");
        }
        if(i != 4) printf("####################\n");
    }
}